package com.carl.controller;


import com.carl.model.User;
import com.carl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenzhuo_m
 * @since 2018-09-28
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService ;

    @ResponseBody
    @RequestMapping("/{id}/info")
    public User getUserInfo(@PathVariable("id") Long userId) {
        User user = userService.selectById(userId);
        return user;
    }

}

